using System;
using System.Data;
using System.Configuration;
using System.Web;			 
using System.Drawing;    

namespace Possan.Graphics.Filters
{						  
	public class FillColor : IBaseFilter
	{
		public string ParameterDefinition
		{
			get
			{
				     return null;
			}
		}

		public string Color;

		public FillColor()
		{
			Color = "#000000";
		}

		public Bitmap Filter(Bitmap bmp)
		{
			Bitmap bmp2 = new Bitmap(bmp.Width, bmp.Height);
			bmp2.SetResolution(bmp.HorizontalResolution, bmp.VerticalResolution);
			Color fill = Utilities.ParseHtmlColor(Color);
			for (int v = 0; v < bmp.Height ;  v++)
			{
				for (int u = 0; u < bmp.Width ;  u++)
				{
					Color oldcolor = bmp.GetPixel(u, v);
					Color newcolor = System.Drawing.Color.FromArgb(oldcolor.A, fill);
					bmp2.SetPixel(u, v, newcolor);
				}
			}
			     return bmp2;
		}
	}
}





